﻿using BingYing.SAAS.SystemModel.Domain;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.ChangeTrackers;
using Volo.Abp.Modularity;

namespace BingYing.SAAS.SystemModel.EntityFramework
{
    [DependsOn(
        typeof(AbpEntityFrameworkCoreModule),
        typeof(SystemModelDomainModule)
        )]
    public class SystemModelEntityFrameworkModule:AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            context.Services.AddAbpDbContext<SystemModelDbContext>(opt =>
            {
                opt.AddDefaultRepositories(true);
            })
                .Configure<AbpDbContextOptions>(opt =>
                {
                    opt.UseSqlServer();
                    
                });
            //context.Services.AddScoped<IAbpLazyServiceProvider,AbpLazyServiceProvider>();
           //context.Services.AddScoped<EfCoreRepository<,>,IEfCoreRepository<>>();
            base.ConfigureServices(context);
        }
    }
}
